package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.statistics.*;
import com.gxa.service.StatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller     //修饰整个类，描述Controller的作用
//在  http://localhost:8080/swagger-ui.html  地址中查看下面的效果
@Api(value = "数据统计",tags = "数据统计接口API")   //  value：代表代码级描述  tags：代表页面级描述
@RequestMapping(value = "/statistics/*")   //接口和前端传递数据方式
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    @RequestMapping(value = "/comprehensiveData" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "综合数据接口",notes = "不传递值",httpMethod = "GET", response = ComprehensiveData.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //综合数据接口
    public R comprehensiveData(){
        return statisticsService.comprehensiveData();
    }

    @RequestMapping(value = "/talentReserve" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "人才储备接口",notes = "不传递值",httpMethod = "GET", response = TalentReserve.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //人才储备接口
    public R talentReserve(){
        return statisticsService.talentReserve();
    }

    @RequestMapping(value = "/departmentStaff" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "部门员工接口",notes = "不传递值",httpMethod = "GET", response = DepartmentStaff.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //部门员工接口
    public R departmentStaff(){
        return statisticsService.departmentStaff();
    }

    @RequestMapping(value = "/employeeBasic" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "员工基本接口",notes = "不传递值",httpMethod = "GET", response = EmployeeBasic.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //员工基本接口
    public R employeeBasic(){
        return statisticsService.employeeBasic();
    }

    @RequestMapping(value = "/employeeMonth" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "员工月份接口",notes = "不传递值",httpMethod = "GET", response = EmployeeMonth.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //员工月份接口
    public R employeeMonth(){
        return statisticsService.employeeMonth();
    }

    @RequestMapping(value = "/employeeSex" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "员工性别接口",notes = "不传递值",httpMethod = "GET", response = R.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //员工性别接口
    public R employeeSex(){
        return statisticsService.employeeSex();
    }

    @RequestMapping(value = "/jobStatus" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "在职状态接口",notes = "不传递值",httpMethod = "GET", response = R.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //在职状态接口
    public R  jobStatus(){
        return statisticsService.jobStatus();
    }

    @RequestMapping(value = "/blackList" , method = RequestMethod.GET)   //接口和前端传递数据方式
    @ApiOperation(value = "黑名单接口",notes = "不传递值",httpMethod = "GET", response = R.class)  //swagger对方法的详细描述
    @ResponseBody   //响应json数据给前端
    //黑名单接口
    public R blackList(){
        return statisticsService.blackList();
    }

}
